/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package load.drawing;

import core.InPort;
import core.StdNode;
import core.TriggerPort;
import java.awt.Graphics;
import java.awt.Image;

/**
 *
 * @author Ben
 */
public class DrawImage  extends StdNode{
    private InPort x = new InPort(Integer.class);
    private InPort y = new InPort(Integer.class);
    private InPort image = new InPort(Image.class);

    private TriggerPort draw = new TriggerPort() {
            @Override
            public void callInternal() {
                Graphics g = controller.StdDraw.getInstance().getGraphics();
                g.drawImage((Image)image.getValue(),(Integer)x.getValue(),
                            (Integer)y.getValue(),null);
            }
    };

    public DrawImage() {
        this.autoPutPorts();
    }

}
